#define _CRT_SECURE_NO_WARNINGS
#include"SeqList.h"

void TestSeqList_one()
{
	SeqList s;
	SeqListInit(&s);

	SeqListPushBack(&s, 1);
	SeqListPushBack(&s, 2);
	SeqListPushBack(&s, 3);
	SeqListPushBack(&s, 4);
	SeqListPushBack(&s, 5);
	SeqListPrint(&s);

	SeqListPopBack(&s);
	SeqListPrint(&s);

	SeqListPopBack(&s);
	SeqListPrint(&s);

	SeqListPopBack(&s);
	SeqListPrint(&s);

	SeqListPopBack(&s);
	SeqListPrint(&s);

	SeqListPopBack(&s);
	SeqListPrint(&s);
}

void TestSeqList_two()
{
	SeqList s;
	SeqListInit(&s);

	SeqListPushFront(&s, 1);
	SeqListPushFront(&s, 2);
	SeqListPushFront(&s, 3);
	SeqListPushFront(&s, 4);
	SeqListPushFront(&s, 5);
	SeqListPrint(&s);

	SeqListPopFront(&s);
	SeqListPrint(&s);

	SeqListPopFront(&s);
	SeqListPrint(&s);

	SeqListPopFront(&s);
	SeqListPrint(&s);

	SeqListPopFront(&s);
	SeqListPrint(&s);

	SeqListPopFront(&s);
	SeqListPrint(&s);
}

void TestSeqList_three()
{
	SeqList s;
	SeqListInit(&s);
	
	SeqListPushFront(&s, 1);
	SeqListPushFront(&s, 2);
	SeqListPushFront(&s, 3);
	SeqListPushFront(&s, 4);
	SeqListPushFront(&s, 5);
	SeqListPrint(&s);

	SeqListInsert(&s, 2, 9);
	SeqListPrint(&s);

	SeqListErase(&s, 1);
	SeqListPrint(&s);

	int pos = SeqListFind(&s, 9);
	SeqListInsert(&s, pos, 8);
	SeqListPrint(&s);
}

int main()
{
	TestSeqList_one();
	TestSeqList_two();
	TestSeqList_three();
	
	return 0;
}